package com.xucranger.ojapi.enity.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import lombok.Data;

/**
 *
 * @TableName student
 */
@TableName(value ="student")
@Data
public class Student implements Serializable {
    /**
     * 学号
     */
    @TableId
    private String stuid;

    /**
     * 姓名
     */
    private String stuname;

    /**
     * 班级
     */
    private String stuclass;

    /**
     * atcoder账号
     */
    private String stuAcid;

    /**
     * codeforces账号
     */
    private String stuCfid;

    private String stuCfid1;

    private String stuCfid2;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Student other = (Student) that;
        return (this.getStuid() == null ? other.getStuid() == null : this.getStuid().equals(other.getStuid()))
                && (this.getStuname() == null ? other.getStuname() == null : this.getStuname().equals(other.getStuname()))
                && (this.getStuclass() == null ? other.getStuclass() == null : this.getStuclass().equals(other.getStuclass()))
                && (this.getStuAcid() == null ? other.getStuAcid() == null : this.getStuAcid().equals(other.getStuAcid()))
                && (this.getStuCfid() == null ? other.getStuCfid() == null : this.getStuCfid().equals(other.getStuCfid()))
                && (this.getStuCfid1() == null ? other.getStuCfid1() == null : this.getStuCfid1().equals(other.getStuCfid1()))
                && (this.getStuCfid2() == null ? other.getStuCfid2() == null : this.getStuCfid2().equals(other.getStuCfid2()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStuid() == null) ? 0 : getStuid().hashCode());
        result = prime * result + ((getStuname() == null) ? 0 : getStuname().hashCode());
        result = prime * result + ((getStuclass() == null) ? 0 : getStuclass().hashCode());
        result = prime * result + ((getStuAcid() == null) ? 0 : getStuAcid().hashCode());
        result = prime * result + ((getStuCfid() == null) ? 0 : getStuCfid().hashCode());
        result = prime * result + ((getStuCfid1() == null) ? 0 : getStuCfid1().hashCode());
        result = prime * result + ((getStuCfid2() == null) ? 0 : getStuCfid2().hashCode());



        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", stuid=").append(stuid);
        sb.append(", stuname=").append(stuname);
        sb.append(", stuclass=").append(stuclass);
        sb.append(", stuAcid=").append(stuAcid);
        sb.append(", stuCfid=").append(stuCfid);
        sb.append(", stuCfid1=").append(stuCfid1);
        sb.append(", stuCfid2=").append(stuCfid2);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}